<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改成本中心')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-department-edit" th:object="${businessUnitDepartment}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">事业部：</label>
                <div class="col-sm-8">
                    <select name="businessUnitId" th:field="*{businessUnitId}" id="businessUnitId" style="width: 100px;" class="form-control m-b" th:with="type=${@customDictService.selectDictBusinessUnit()}" required>
                        <option value="">--请选择--</option>
                        <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input name="priority" th:field="*{priority}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">编码：</label>
                <div class="col-sm-8">
                    <input name="code" th:field="*{code}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">开启现金流：</label>
                <div class="col-sm-8">
                    <select name="hasFlow"  class="form-control" th:field="*{hasFlow}" th:with="type=${@dict.getType('open_status')}" required>
                        <option value="">--请选择--</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">启动资金：</label>
                <div class="col-sm-8">
                    <input name="account" th:field="*{account}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">启动日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="registerDate" th:value="${#dates.format(businessUnitDepartment.registerDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">额外资金：</label>
                <div class="col-sm-8">
                    <input name="extraFund" th:field="*{extraFund}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">额外资金性质：</label>
                <div class="col-sm-8">
                    <input name="extraNature" th:field="*{extraNature}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">额外资金说明：</label>
                <div class="col-sm-8">
                    <textarea name="extraInfo" class="form-control">[[*{extraInfo}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">钉钉部门编号：</label>
                <div class="col-sm-8">
                    <input name="dingdingCode" th:field="*{dingdingCode}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">禁用状态：</label>
                <div class="col-sm-8">
                    <select name="disabled"  class="form-control" th:field="*{disabled}" th:with="type=${@dict.getType('sys_yes_no')}" >
                        <option value="">--请选择--</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/businessUnit/department";
        $("#form-department-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-department-edit').serialize());
            }
        }

        $("input[name='registerDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>